package cn.school.test;

import cn.school.dao.StudentMapper;
import cn.school.entity.Student;
import cn.school.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class TEstSearch {
    public static void main(String[] args) throws ParseException {
        SqlSession s= MybatisUtil.get();
        StudentMapper mapper = s.getMapper(StudentMapper.class);
        SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
//        List<Student>  list = mapper.search(1, 20, "李", null, null, df.parse("2017-1-1"), df.parse("2020-12-1"));
//        list.forEach(System.out::println);
//        List<Student>  list2 = mapper.search(1, 20, "", "15", null, df.parse("2017-1-1"), df.parse("2020-12-1"));
//        list2.forEach(System.out::println);
        List<Student>  list2 = mapper.search(1, 20, "", "", "138", null, null);
        list2.forEach(System.out::println);
        MybatisUtil.close(s);
    }
}
